package com.xuecheng.content.controller;

import com.xuecheng.commons.model.dto.BindTeachplanMediaDto;
import com.xuecheng.commons.model.vo.ResponseResult;
import org.springframework.web.bind.annotation.*;
import com.xuecheng.content.service.TeachplanMediaService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author itheima
 */
@Slf4j
@RestController
public class TeachplanMediaController {

    @Autowired
    private TeachplanMediaService teachplanMediaService;

    // 计划绑定媒资
    @PostMapping("/teachplan/media/association")
    public ResponseResult association(@RequestBody BindTeachplanMediaDto dto) {
        return teachplanMediaService.association(dto);
    }

    //媒资解绑
    @DeleteMapping("/teachplan/media/{teachPlanMediaId}")
    public ResponseResult deleteTeachPlanMedia(@PathVariable("teachPlanMediaId") Long teachPlanMediaId) {
        return teachplanMediaService.deleteTeachPlanMedia(teachPlanMediaId);
    }
}
